<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="btn">复制</button>
    <script>
        btn.addEventListener('click',function(){
            
            let textarea=document.createElement('textarea')
            document.body.appendChild(textarea)
            textarea.style.position='absolute'
            textarea.style.clip='rect(0 0 0 0)'
            textarea.value='copy的内容'

            textarea.select()

            document.execCommand('copy',true)



        })
        // CSS filter svg canvas  可以做成各种形状
    </script>
</body>
</html>